Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fmtr

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fmtr

awesome string formatter

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

fmtr

Awesome string formatting using shell style place holders.

Installation

npm install --save fmtr

API

fmtr(format, obj)

Parameters:

  • format string with ${propertyName} placeholder(s) where propertyName is the name of a property of obj
  • obj an object containing values to substitute into the format string.

Returns:

  • string

Example

"use strict";

var fmtr = require('fmtr');

var user = {
    username: 'alice',
    spouse: 'bob',
    enemy: 'eve'
};

console.log(fmtr('${username} is married to ${spouse} and hates ${enemy}', user));

// prints "alice is married to bob and hates eve"

Testing

npm test

License

See LICENSE.md

Keywords

FAQs

Package last updated on 17 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc